package org.springblade.modules.repair.vo.statistics;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description
 * @Author ysq
 * @Date 2022/9/2
 **/
@Data
public class DeptWorkTimeDetailVO {

	@ApiModelProperty(value = "组名称")
	private String deptName;

	@ApiModelProperty(value = "作业人数")
	private Long workUserCount;

	@ApiModelProperty(value = "人均作业天数")
	private BigDecimal divUserWorkDayCount;

	@ApiModelProperty(value = "人均每日作业时长")
	private BigDecimal divUserDayWorkTime;

	@ApiModelProperty(value = "保养作业累计时长")
	private BigDecimal byWorkTimeTotal;

	@ApiModelProperty(value = "维修作业累计时长")
	private BigDecimal wxWorkTimeTotal;

	@ApiModelProperty(value = "配件作业累计时长")
	private BigDecimal pjWorkTimeTotal;

	@ApiModelProperty(value = "作业累计时长")
	private BigDecimal totalWorkHour;

	public void setDivUserDayWorkTime(Integer divUserDayWorkTime) {
		this.divUserDayWorkTime = new BigDecimal(divUserDayWorkTime).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setDivUserWorkDayCount(BigDecimal divUserWorkDayCount) {
		this.divUserWorkDayCount = divUserWorkDayCount.setScale(1, BigDecimal.ROUND_HALF_UP);
	}

	public void setByWorkTimeTotal(Integer byWorkTimeTotal) {
		this.byWorkTimeTotal = new BigDecimal(byWorkTimeTotal).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setWxWorkTimeTotal(Integer wxWorkTimeTotal) {
		this.wxWorkTimeTotal = new BigDecimal(wxWorkTimeTotal).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setPjWorkTimeTotal(Integer pjWorkTimeTotal) {
		this.pjWorkTimeTotal = new BigDecimal(pjWorkTimeTotal).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setTotalWorkHour(Integer totalWorkHour) {
		this.totalWorkHour = new BigDecimal(totalWorkHour).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public BigDecimal getTotalWorkHour() {
		if (this.totalWorkHour == null) {
			this.totalWorkHour = BigDecimal.ZERO.setScale(2);
		}
		return totalWorkHour;
	}

	public BigDecimal getDivUserDayWorkTime() {
		if (this.divUserDayWorkTime == null) {
			this.divUserDayWorkTime = BigDecimal.ZERO.setScale(2);
		}
		return divUserDayWorkTime;
	}

	public BigDecimal getByWorkTimeTotal() {
		if (this.byWorkTimeTotal == null) {
			this.byWorkTimeTotal = BigDecimal.ZERO.setScale(2);
		}
		return byWorkTimeTotal;
	}

	public BigDecimal getWxWorkTimeTotal() {
		if (this.wxWorkTimeTotal == null) {
			this.wxWorkTimeTotal = BigDecimal.ZERO.setScale(2);
		}
		return wxWorkTimeTotal;
	}

	public BigDecimal getPjWorkTimeTotal() {
		if (this.pjWorkTimeTotal == null) {
			this.pjWorkTimeTotal = BigDecimal.ZERO.setScale(2);
		}
		return pjWorkTimeTotal;
	}

	public Long getWorkUserCount() {
		if (this.workUserCount == null) {
			this.workUserCount = 0L;
		}
		return workUserCount;
	}
}
